package com.sunbim.rsrv.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 结构安全风险
 * </p>
 *
 * @author yuhui
 * @since 2021-12-30
 */
@Getter
@Setter
@TableName("risk_struct")
@ApiModel(value = "RiskStruct对象", description = "结构安全风险")
public class RiskStruct implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("所属用户id")
    @JsonProperty("user_id")
    @TableField("user_id")
    private Integer userId;

    @ApiModelProperty("所属文物id")
    @JsonProperty("relics_id")
    @TableField("relics_id")
    private Integer relicsId;



    @ApiModelProperty("单个构件")
    @TableField("single")
    @NotNull(message = "单个构件风险分数不能为空")
    private Integer single;

    @ApiModelProperty("节点及连接")
    @TableField("node")
    @NotNull(message = "节点及连接风险分数不能为空")
    private Integer node;

    @ApiModelProperty("结构整体性")
    @TableField("overall")
    @NotNull(message = "结构整体性风险分数不能为空")
    private Integer overall;

    @ApiModelProperty("总分")
    @TableField("score")
    private Integer score;

    @ApiModelProperty("风险等级")
    @TableField(exist = false)
    private Integer level;


    @ApiModelProperty("主要问题")
    @TableField("problem")
    private String problem;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonProperty(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonProperty(value = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


}
